package com.day16;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class PropertiesTest {

    //Properties:常用来处理配置文件，key和value都是String类型
    public static void main(String[] args) throws IOException {
        try {
            Properties properties = new Properties();
            FileInputStream fileInputStream = new FileInputStream("jdbc.properties");
            properties.load(fileInputStream);  //加载流对应的文件

            String name = properties.getProperty("name");
            String password = properties.getProperty("password");
            System.out.println(name + password);
        } finally {
           //关闭输入流
        }


    }
}
